/**
 * 
 */
package org.softTank.BC.data;

import java.util.ArrayList;
import java.util.List;

import javax.xml.namespace.QName;

import org.softTank.schema.bean.ComplexType;
import org.softTank.schema.bean.Element;
import org.softTank.schema.bean.Schema;
import org.softTank.schema.bean.Sequence;
import org.softTank.wsdlParser.bean.Definitions;
import org.softTank.wsdlParser.bean.Message;
import org.softTank.wsdlParser.bean.Operation;
import org.softTank.wsdlParser.bean.ParamType;
import org.softTank.wsdlParser.bean.Part;
import org.softTank.wsdlParser.bean.PartnerLinkType;
import org.softTank.wsdlParser.bean.PortType;
import org.softTank.wsdlParser.bean.Role;
import org.softTank.wsdlParser.bean.Types;

/**
 * @author Yuzone
 *
 */
public class DefinitionsData {

	public static Definitions getTestDefinitions() {
		Definitions definitions = new Definitions();

		PartnerLinkType plt = new PartnerLinkType();
		plt.setName(new QName("ns of PartnerLinkType", "partnerLinkType"));

		Role role = new Role();
		role.setName(new QName("ns of Role", "role"));
		role.setPortType(new QName("ns of PortType", "portType"));
		List<Role> rl = new ArrayList<Role>();
		rl.add(role);
		plt.setRole(rl);

		Types types = new Types();
		Schema schema = new Schema();
		Element e = new Element();
		e.setName(new QName("parameter"));
		Sequence s = new Sequence();
		s.getElement().add(e);
		ComplexType ct = new ComplexType();
		ct.setSequence(s);
		e = new Element();
		e.setName(new QName("element"));
		e.setComplexType(ct);
		schema.getElement().add(e);
		types.setSchema(schema);

		Part part = new Part();
		part.setName(new QName("ns of Part", "part"));
		part.setElement(new QName("ns of element", "element"));

		Message msg = new Message();
		msg.setName(new QName("ns of Message", "message"));
		List<Part> pl = new ArrayList<Part>();
		pl.add(part);
		msg.setPart(pl);

		ParamType pt = new ParamType();
		pt.setName(new QName("ns of ParamType", "paramType"));
		pt.setMessage(msg.getName());

		Operation op = new Operation();
		op.setName(new QName("ns of Operation", "operation"));
		op.setOutput(pt);

		PortType portT = new PortType();
		portT.setName(new QName("ns of PortType", "portType"));
		List<Operation> ol = new ArrayList<Operation>();
		ol.add(op);
		portT.setOperation(ol);

		definitions.setTargetNamespace("targetNamespace of definitions");
		definitions.setName(new QName("tns", "definitions"));
		List<PartnerLinkType> partnerl = new ArrayList<PartnerLinkType>();
		partnerl.add(plt);
		definitions.setPartnerLinkType(partnerl);
		List<PortType> portl = new ArrayList<PortType>();
		portl.add(portT);
		definitions.setPortType(portl);
		List<Message> msgl = new ArrayList<Message>();
		msgl.add(msg);
		definitions.setMessage(msgl);
		definitions.setTypes(types);

		return definitions;
	}
}
